package com.xusheng.cli.controller.open;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xusheng.cli.common.base.Result;
import com.xusheng.cli.entity.customerServiceModule.CustomerService;
import com.xusheng.cli.service.CustomerServiceService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 客服(CustomerService)表控制层
 *
 * @author whr
 * @since 2023-09-06 11:34:37
 */
@Validated
@RestController
@RequestMapping("/open/v1/customerService")
public class CustomerServiceController {
    /**
     * 服务对象
     */
    @Resource
    private CustomerServiceService customerServiceService;

    /**
     * 查询所有数据
     *
     * @param customerService 查询实体
     * @return 所有数据
     * @author whr
     * @since 2023-09-06 11:34:37
     */
    @GetMapping("queryAll")
    public Result<List<CustomerService>> queryAll(CustomerService customerService) {
        customerService.setState(true);
        return Result.success(customerServiceService.list(new QueryWrapper<>(customerService)));
    }
}

